home *** CD-ROM | disk | FTP | other *** search
- scenario = GetProperties()
- scenario.ScenarioType = 1
- scenario.Title = "sc_Train_06_00"
- scenario.Map = "Beotorum.dat"
- scenario.Description = "sc_Train_06_01"
- scenario.Picture = "Train 06.dds"
- scenario.iSortOrder = 4
-
- scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
- scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
- scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
- scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
-
- Player(PT_PLAYER, RACE_HUMANS)
- Player(PT_AI, RACE_ALIENS)
-
- SetInitialCamera(-0.601535, 0.000000, 0.798847, 0.000000, -0.652736, 0.576498, -0.491513, 0.000000,-0.460534, -0.817098, -0.346784, 0.000000,621.513794, 531.616394, -113.558456, 1.000000)
-
- function InitialMOB()
- StartMOB(1)
-
- MoveUnit(1, 5, 7)
- MoveUnit(2, 5, 5)
- MoveUnit(3, 6, 10)
- MoveUnit(4, 5, 11)
- MoveUnit(5, 5, 9)
-
- FlyCamera(-0.162952, 0.000000, 0.986634, 0.000000, -0.910255, 0.385791, -0.150338, 0.000000,-0.380635, -0.922586, -0.062865, 0.000000,512.935364, 336.092926, -301.628510, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_02")
-
- MoveUnit(4101, 12, 8)
-
- FlyCamera(-0.078375, 0.000000, 0.996924, 0.000000, -0.729729, 0.681326, -0.057369, 0.000000,-0.679229, -0.731980, -0.053399, 0.000000,923.968628, 228.287949, -317.938477, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_03")
-
- FlyCamera(-0.996785, 0.000000, -0.080127, 0.000000, 0.055249, 0.724262, -0.687308, 0.000000,0.058033, -0.689525, -0.721933, 0.000000,755.021790, 268.665344, -143.030701, 1.000000)
- Fly(4098, 13028)
- Fly(4099, 13028)
- Fly(4100, 13028)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_04")
-
- FlyCamera(-0.695875, 0.000000, 0.718163, 0.000000, -0.661381, 0.389718, -0.640855, 0.000000,-0.279881, -0.920934, -0.271195, 0.000000,745.664246, 161.601517, -213.458069, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_05")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_06")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_07")
-
- FlyCamera(-0.524184, -0.000000, 0.851605, 0.000000, -0.809007, 0.312313, -0.497963, 0.000000,-0.265968, -0.949979, -0.163710, 0.000000,640.328552, 336.375793, -299.658508, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_08")
-
- SetCameraSpeed(0.4)
- FlyCamera(-0.085583, 0.000000, 0.996331, 0.000000, -0.567308, 0.822063, -0.048731, 0.000000,-0.819046, -0.569397, -0.070355, 0.000000,519.362488, 102.136452, -285.686218, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 315, "sc_Train_06_09")
- SetCameraSpeed(1)
-
- FlyCamera(0.705589, 0.000000, 0.708622, 0.000000, -0.629390, 0.459479, 0.626696, 0.000000,-0.325597, -0.888189, 0.324203, 0.000000,771.880005, 390.186371, -492.092743, 1.000000)
-
- FinishMOB()
- end
-
- function OnEndAITurn()
- if GetHP(2) == 4 then
- StartMOB(1)
- FlyCamera(0.310873, -0.000000, 0.950451, 0.000000, -0.781777, 0.568719, 0.255703, 0.000000,-0.540540, -0.822532, 0.176799, 0.000000,616.212463, 131.282776, -194.578766, 1.000000)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_10")
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_11")
- FinishMOB()
- end
-
- local pos = GetPos(4101)
- if pos.x == 11 and pos.y == 7 and ( IsAlive(1) or IsAlive(2) or IsAlive(3) ) then
- StartMOB(1)
- SetMP(4101, 0)
- FinishMOB()
- end
- end
-
- function OnHexClicked(x, y, clicked_unit, selected_unit, command)
- if selected_unit == 4101 and command == CMD_MOVE and IsAlive(2) then
- if x ~= 11 or y ~= 7 then
- IncorrectAction("sc_Train_06_27")
- end
- end
-
- if command == CMD_SELECT and GetType( clicked_unit ) == AIR and HasFired( clicked_unit ) then
- StartMOB(1)
- ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_06_27a")
- FinishMOB()
- end
-
- local target
-
- if ( IsAlive( 1 ) ) then
- target = 1
- elseif ( IsAlive( 2 ) ) then
- target = 2
- elseif ( IsAlive( 3 ) ) then
- target = 3
- elseif ( IsAlive( 4 ) ) then
- target = 4
- elseif ( IsAlive( 5 ) ) then
- target = 5
- end
-
- if command == CMD_FIRE or command == CMD_BOMB then
- if ( clicked_unit ~= target ) then
- IncorrectAction("sc_Train_06_28")
- end
- end
- end
-
- old_prompt = ""
-
- local bCanEndPhase = false
-
- function OnUpdate()
- bCanEndPhase = false
-
- if IsAlive( 4101 ) then
- if not HasFired( 4101 ) then
- if CanAttackThisTurn( 4101, 2 ) and IsAlive( 2 ) and GetHP( 2 ) <= 2 then
- ShowPrompting("sc_Train_06_12")
- return
- end
-
- if CanAttackThisTurn( 4101, 4 ) and IsAlive( 4 ) and GetHP( 4 ) <= 2 then
- ShowPrompting("sc_Train_06_13")
- return
- end
-
- if CanAttackThisTurn( 4101, 5 ) and IsAlive( 5 ) and GetHP( 5 ) <= 2 then
- ShowPrompting("sc_Train_06_14")
- return
- end
- end
- end
-
- local nFired = 0
- for id = 4098, 4100 do
- if HasFired( id ) then
- nFired = nFired + 1
- end
- end
-
- if nFired < 3 then
- if GetType( GetSelectedUnit() ) ~= AIR or HasFired( GetSelectedUnit() ) then
- if not IsDesantInfoDisplaying() then
- ShowPrompting("sc_Train_06_15")
- elseif nFired == 0 then
- ShowPrompting("sc_Train_06_16")
- elseif nFired == 1 then
- ShowPrompting("sc_Train_06_17")
- elseif nFired == 2 then
- ShowPrompting("sc_Train_06_18")
- end
-
- return
- end
- end
-
- if GetType( GetSelectedUnit() ) == AIR and not HasFired( GetSelectedUnit() ) then
- if IsAlive( 1 ) then
- ShowPrompting("sc_Train_06_19")
- elseif IsAlive( 2 ) then
- ShowPrompting("sc_Train_06_20")
- elseif IsAlive( 3 ) then
- ShowPrompting("sc_Train_06_21")
- elseif IsAlive( 4 ) then
- ShowPrompting("sc_Train_06_22")
- else
- ShowPrompting("sc_Train_06_23")
- end
-
- return
- end
-
- if IsAlive( 4101 ) then
- local bCapitalDanger = false
-
- for enemy = 1, 5 do
- if GetUnitTurnsTo( enemy, 11, 7, true ) <= 1 then
- bCapitalDanger = true
- break
- end
- end
-
- if bCapitalDanger then
- ShowPrompting("sc_Train_06_24")
- return
- end
- end
-
- if not HasPrompting() then
- ShowPrompting("sc_Train_finish_phase")
- bCanEndPhase = true
- end
- end
-
- function OnUnitDead(unit)
- if GetAliveUnitsAmount(COLOR_RED) == 0 then
- StartMOB(1)
- ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_06_25")
- ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_06_26")
- ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_06_26a")
- ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_06_26b")
- FinishMOB()
- end
- end
-
- function OnEndPhase( phase )
- if phase == PHASE_COMBAT then
- if not bCanEndPhase then
- IncorrectAction("sc_Train_01_05")
- end
- end
- end
-
- function CheckForVictory()
- if(GetAliveUnitsAmount(COLOR_RED) == 0) then
- return GAMERESULT_VICTORY
- end
-
- if(IsDead(4098)) then
- return GAMERESULT_DEFEAT
- end
-
- return GAMERESULT_NONE
- end
-
- function aiUnit(unit)
- aiMustNot()
- aiSetFear(0)
- aiHexAttraction(11, 7, 3)
- end
-
- function InitialSetup()
- Country(5, ALLIANCE_FNU_ALLY)
- Money(5, MONEY_TOTAL_REVENUE, 0)
-
- Country(14, ALLIANCE_NEUTRAL_FNU)
- Money(14, MONEY_GUERRILLA, 0)
- Money(14, MONEY_TOTAL_REVENUE, 0)
-
- Country(13, ALLIANCE_FL_ALLY)
- Money(13, MONEY_TOTAL_REVENUE, 0)
-
- SetupUnit(4098, AIR, 17, 21, 0)
- SetupUnit(4099, AIR, 17, 21, 1)
- SetupUnit(4100, AIR, 17, 21, 2)
- SetupUnit(4101, TANK, 10, 10)
- SetMP(4101, 0)
-
- SetupUnit(1, ARTILLERYA, 4, 8)
- SetupUnit(2, AMPHIBIAA, 2, 8)
- SetupUnit(3, TANKA, 5, 11)
- SetupUnit(4, TANKA, 4, 12)
- SetupUnit(5, LBOTA, 4, 10)
- end
-